var User=require('../models/userModel.js');
var code=require('../txtCode/code.js');

module.exports={
	GetHtml:function(req,res){
		if(req.session.token){
			res.render('addAssistant',function(err,html){
				res.send(html);
			});
		}
	},
	AddAssistant:function(req,res){
		if(req.session.token){
			var data=req.body;
			var oNewAssistant=new User(data);
			oNewAssistant.save().then(
				function(data){
					res.send({code:code.success});	
					},
				function(err){
					console.log(err);
					res.send({code:code.insertFail});
			});//save()

		}//if
	}//AddAssistant,
}